﻿#include "FITKAbaMaterialPlastic.h"


Interface::FITKAbaMaterialBehaviorEnum::FITKAbaMaterialBehaviorType Interface::FITKAbaMaterialPlastic::getMaterialBehaviorType()
{
    return FITKAbaMaterialBehaviorEnum::FITKAbaMaterialBehaviorType::Plastic;
}

Interface::FITKAbaMaterialBehaviorEnum::FITKAbaMaterialPlasticType Interface::FITKAbaMaterialPlastic::getPlasticType() const
{
    return m_plasticType;
}

void Interface::FITKAbaMaterialPlastic::setPlasticType(FITKAbaMaterialBehaviorEnum::FITKAbaMaterialPlasticType type)
{
    m_plasticType = type;
}

bool Interface::FITKAbaMaterialPlastic::getUseTemperatureDependentData() const
{
    return m_useTemperatureDependentData;
}

void Interface::FITKAbaMaterialPlastic::setUseTemperatureDependentData(bool stat)
{
    m_useTemperatureDependentData = stat;
}

bool Interface::FITKAbaMaterialPlastic::getUseStrainRateDependentData() const
{
    return m_useStrainRateDependentData;
}

void Interface::FITKAbaMaterialPlastic::setUseStrainRateDependentData(bool stat)
{
    m_useStrainRateDependentData = stat;
}

double Interface::FITKAbaMaterialPlastic::getJohnsonCookA() const
{
    return m_johnsonCook.getA();
}

double Interface::FITKAbaMaterialPlastic::getJohnsonCookB() const
{
    return m_johnsonCook.getB();
}

double Interface::FITKAbaMaterialPlastic::getJohnsonCookn() const
{
    return m_johnsonCook.getN();
}

double Interface::FITKAbaMaterialPlastic::getJohnsonCookm() const
{
    return m_johnsonCook.getM();
}

void Interface::FITKAbaMaterialPlastic::setJohnsonCookn(double value)
{
    m_johnsonCook.setN(value);
}

void Interface::FITKAbaMaterialPlastic::setJohnsonCookMeltingTemp(double value)
{
    m_johnsonCook.setMeltingTemp(value);
}

void Interface::FITKAbaMaterialPlastic::setJohnsonCookTransitionTemp(double value)
{
    m_johnsonCook.setTransitionTemp(value);
}

int Interface::FITKAbaMaterialPlastic::getNumberOfIsotropicDataRows() const
{
    return m_isotropicDatas.size();
}

void Interface::FITKAbaMaterialPlastic::setNumberOfIsoTropicDataRows(int rows)
{
    if (rows >= 1)
        m_isotropicDatas.resize(rows);
}

void Interface::FITKAbaMaterialPlastic::insertIsotropicDataRow(int index)
{
    m_isotropicDatas.insert(index, PlasticIsotropic());
}

void Interface::FITKAbaMaterialPlastic::removeIsoTropicDataRow(int index)
{
    if (m_isotropicDatas.size() == 1)
        return;
    if (index >= 0 && index < m_isotropicDatas.size())
        m_isotropicDatas.removeAt(index);
}

double Interface::FITKAbaMaterialPlastic::getIsotropicYieldStress(int index)
{
    if (index >= 0 && index < m_isotropicDatas.size())
        return m_isotropicDatas[index].getYieldStress();
    return 0.0;
}

void Interface::FITKAbaMaterialPlastic::setIsotropicYieldStess(double value, int index)
{
    if (index >= 0 && index < m_isotropicDatas.size())
        m_isotropicDatas[index].setYieldStress(value);
}

double Interface::FITKAbaMaterialPlastic::getIsotropicPlasticStrain(int index)
{
    if (index >= 0 && index < m_isotropicDatas.size())
        return m_isotropicDatas[index].getPlasticStrain();
    return 0.0;
}

void Interface::FITKAbaMaterialPlastic::setIsotropicPlasticStrain(double value, int index)
{
    if (index >= 0 && index < m_isotropicDatas.size())
        m_isotropicDatas[index].setPlasticStrain(value);
}

double Interface::FITKAbaMaterialPlastic::getIsotropicRate(int index)
{
    if (index >= 0 && index < m_isotropicDatas.size())
        return m_isotropicDatas[index].getRate();
    return 0.0;
}

void Interface::FITKAbaMaterialPlastic::setIsotropicRate(double value, int index)
{
    if (index >= 0 && index < m_isotropicDatas.size())
        m_isotropicDatas[index].setRate(value);
}

double Interface::FITKAbaMaterialPlastic::getIsotropicTemperature(int index)
{
    if (index >= 0 && index < m_isotropicDatas.size())
        return m_isotropicDatas[index].getTemperature();
    return 0.0;
}

void Interface::FITKAbaMaterialPlastic::setIsotropicTemperature(double value, int index)
{
    if (index >= 0 && index < m_isotropicDatas.size())
        m_isotropicDatas[index].setTemperature(value);
}

double Interface::FITKAbaMaterialPlastic::getJohnsonCookMeltingTemp() const
{
    return m_johnsonCook.getMeltingTemp();
}

double Interface::FITKAbaMaterialPlastic::getJohnsonCookTransitionTemp() const
{
    return m_johnsonCook.getTransitionTemp();
}

void Interface::FITKAbaMaterialPlastic::setJohnsonCookA(double value)
{
    m_johnsonCook.setA(value);
}

void Interface::FITKAbaMaterialPlastic::setJohnsonCookB(double value)
{
    m_johnsonCook.setB(value);
}

void Interface::FITKAbaMaterialPlastic::setJohnsonCookm(double value)
{
    m_johnsonCook.setM(value);
}
